package org.syncsoft.overalt.communication.api;

import org.apache.http.HttpEntity;
import org.syncsoft.overalt.communication.exception.ConnectionException;

/**
 * provide a interface to convert httpEntity in object
 * @author tptfc
 *
 */
public interface IConnectionEntityConverter<T>  {
	/**
	 * @precondition	entity != null
	 * 					this method can't be executed in parallel with result
	 * @postcondition result != null
	 * 
	 * @param entity
	 */
	void process(HttpEntity entity) throws ConnectionException;
	
	/**
	 * @precondition	process was executed before
	 * 					this method can't be executed in parallel with result
	 * 
	 * @return the converted object
	 */
	T result();
}
